<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: edit.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright © since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	© 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	© 2002-2003 osCommerce - www.oscommerce.com
* 	© 2003     nextcommerce - www.nextcommerce.org
* 	© 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

$mail_edit = $db->db_query("SELECT 
								* 
							FROM 
								".TABLE_EMAILS." 
							WHERE 
								languages_id = '".(int)$_GET['lang']."' 
							AND 
								email_name = '".$_GET['mail']."' ");
?>
<table class="table_pageHeading" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td class="pageHeading"><?php echo constant(strtoupper($mail_edit->fields['email_name'].'_TITLE')) ?> bearbeiten <a name="bearbeiten"></a></td>
	</tr>
</table>
<?php echo draw_form('save_mail', 'emails.php', 'action=save_mail&'.getMenuID('emails'), 'post', 'id="dialog_form"'); ?>
	<table border="0" width="100%" cellspacing="0" cellpadding="2">
		<tr>
			<td class="main" width="1"><nobr><?php echo MAIL_ADDRESS ?></nobr></td>
			<td class="main"><?php echo draw_input_field('email_address', $mail_edit->fields['email_address'], 'size="30"') ?></td>
		</tr>
		<tr>
			<td class="main"><nobr><?php echo MAIL_ADDRESS_NAME ?></nobr></td>
			<td class="main"><?php echo draw_input_field('email_address_name', $mail_edit->fields['email_address_name'], 'size="30"') ?></td>
		</tr>
		<tr>
			<td class="main"><nobr><?php echo MAIL_REPLY_ADDRESS ?></nobr></td>
			<td class="main"><?php echo draw_input_field('email_replay_address', $mail_edit->fields['email_replay_address'], 'size="30"') ?></td>
		</tr>
		<tr>
			<td class="main"><nobr><?php echo MAIL_REPLY_ADDRESS_NAME ?></nobr></td>
			<td class="main"><?php echo draw_input_field('email_replay_address_name', $mail_edit->fields['email_replay_address_name'], 'size="30"') ?></td>
		</tr>
		<tr>
			<td class="main"><nobr><?php echo MAIL_SUBJECT ?></nobr></td>
			<td class="main"><?php echo draw_input_field('email_subject', $mail_edit->fields['email_subject'], 'size="30"') ?></td>
		</tr>
		<tr>
			<td class="main"><nobr><?php echo MAIL_FORWARD ?></nobr></td>
			<td class="main"><?php echo draw_input_field('email_forward', $mail_edit->fields['email_forward'], 'size="30"') ?></td>
		</tr>
	
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td colspan="2" align="left">
				<div style="border: 1px solid #ccc">
					<?php
						if(isset($_GET['type']) && $_GET['type'] == 'text') { ?>
							<textarea id="email_content" rows="40" cols="50" style="width:99%" name="email_content"><?php echo stripslashes($mail_edit->fields['email_content_text']);?></textarea>
						<?php echo draw_hidden_field('type','text');
	
						} else { ?>
							<textarea id="email_content" rows="40" cols="50" style="width:99%" name="email_content"><?php echo stripslashes($mail_edit->fields['email_content_html']);?></textarea>
						<?php echo draw_hidden_field('type','html');
						}
						echo draw_hidden_field('lang',$_GET['lang']);
						echo draw_hidden_field('mail',$_GET['mail']);
					?>
				</div>
			</td>
		</tr>
	</table>
</form>